package com.authsphere.common.verifiy;

import java.util.concurrent.TimeUnit;

/**
 * @program: AuthSphere
 * @description:
 * @author: YuKai Fan
 * @create: 2025/3/11 16:16
 **/
public interface VerificationCodeAuthenticator {

    /**
     * 匹配验证码
     * @param rawKey rawKey
     * @param rawCode rawCode
     * @return
     */
    boolean matches(String rawKey, String rawCode);

    /**
     * 设置验证码
     * @param key
     * @param value
     * @param expire
     * @param timeUnit
     * @return
     */
    boolean set(String key, String value, long expire, TimeUnit timeUnit);

    /**
     * 移除验证码
     * @param key
     * @return
     */
    boolean remove(String key);
}
